//
//  DataModel.m
//  dentistry
//
//  Created by mini2 on 15/12/21.
//  Copyright © 2015年 hentica. All rights reserved.
//

#import "DataModel.h"

@implementation DataModel

static DataModel *_dataModel = nil;

+ (DataModel *)getInstance
{
    //初始化一个只执行一次的线程
    static dispatch_once_t onceToken;
    dispatch_once(&onceToken, ^{
        _dataModel = [[self alloc] init];
        
        _dataModel.isLogin = NO;
        _dataModel.deviceToken = @"";
    });
    return _dataModel;
}

#pragma mark -- getter, setter

///获取导航栏高度
- (CGFloat)KNavigationBarHeioght
{
    CGFloat topHeight = kTopHeight;
    if(![self funcisX]){
        if(topHeight > 64.0){
            topHeight = 64.0;
        }
    }
    return topHeight;
}
///配置数据信息
- (Hen_ConfigDBHelper *)configDBHelper
{
    if(!_configDBHelper){
        _configDBHelper = [[Hen_ConfigDBHelper alloc] init];
    }
    return _configDBHelper;
}
- (NSMutableArray *)dicArray{
    if (!_dicArray) {
        _dicArray = [[NSMutableArray alloc] initWithCapacity:0];
    }
    return _dicArray;
}
//高德地图工具
- (AMapUtil *)aMapUtil
{
    if(!_aMapUtil){
        _aMapUtil = [[AMapUtil alloc] init];
    }
    return _aMapUtil;
}

- (BOOL)funcisX
{
    if ([UIScreen mainScreen].bounds.size.height >= 812) {
        return true;
    }
    return false;
}
@end
